home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
a_utils
/
ffccflow
/
ffccflow.lha
/
ffccc+flow
/
ffccc
/
floppy.helpcms
< prev
next >
Wrap
Text File
|
1992-07-31
|
10KB
|
193 lines
.cm CAT:CMS
.cm NAM:FLOPPY
.cm EXP: Fortran Coding Convention Checker
.cm DAT: 87.09.20
.cm A/R: J.J.Bunn
.cm KEY: FLOP TREE TIDY CONVENTION RULE FORTRAN
.cm ABS: A program which checks a Fortran program against
.cm ABS: a pre-defined set of coding conventions.
.cm ABS: Options to tidy the source Fortran and to write
.cm ABS: an input file for FLOW (a separate utility) are
.cm ABS: provided.
.cm FLG: LOCAL
.cm END:
FLOPPY (Coding Convention Checker)
FLOPPY is used to check that a body of Fortran code complies with a set
of coding conventions. This is done by parsing the Fortran using FLOP
(see DD/US/13 Flop User's Guide by H.Grote) and then analysing the
structure against the specified set of instructions.
In addition, FLOPPY may be used to 'tidy' the source Fortran, in other
words to indent the DO/IF clauses, renumber the statement labels, and so
It may also be used to produce an analysis file which is interpreted late
by the TREE utility (type HELP TREE for details). The TREE utility is
capable of giving a graphical representation of the subroutine calling
tree in the source Fortran, as well as for analysing the usage of COMMON
block variables.
FLOPPY is used as follows:
+--------+--------------------------------------------------------------+
| | |
| FLOPPY | [ ? | fn [ft [fm]] [( Options ]] |
| | |
| | Options: |
| | |
| | [CHECKS {STANDARD|NONE|ALEPH|GALEPH|ONLINE|LIST|number_list}]|
| | [DISK] |
| | [FULL] |
| | [GOTOS] |
| | [GROUPF] |
| | [IGNORE] |
| | [INDENT spaces] |
| | [OLD fn ft fm] |
| | [OUTPUT fn ft fm] |
| | [RENUMF start_value[,step_value]] |
| | [RENUMS start_value[,step_value]] |
| | [TIDY] |
| | [TREE] |
+--------+--------------------------------------------------------------+
where:
When FLOPPY is entered without any parameters a panel will be
displayed in which details of the Floppy job may be entered.
? If this is the only operand this HELP file will be displayed.
Fn Ft Fm The file name of the Fortran on which Floppy is to operate.
CHECKS STANDARD The standard set of coding conventions are checked
These are the ones marked by a (*) in the list
below (in Usage Notes).
NONE No coding conventions will be checked. This option
is useful with the TREE option.
LIST The user will be prompted for a list of those
coding conventions he wishes to check.
ALEPH Specifies that the set of conventions is that
agreed on by the Aleph Offline Group.
GALEPH Specifies that the set of conventions is as for
the ALEPH qualifier, but additionally all names
beginning G..... or IG.... will be ignored.
ONLINE This qualifier is not yet implemented.
number_list Numbers should correspond to the numbers in the
list given below. Specifying 99 indicates that
all the checks are to be made. Specifying a
negative number means that the corresponding
convention will not be checked. So for example
CHECKS 99,-1,-20 will cause all conventions
except 1 and 20 to be checked.
DISK Inclusion of this option causes the output from Floppy to be
written to a file.
FULL Specifying this option causes Floppy to print all source Fortra
statements, instead of just those in breach of the coding
conventions checked (which is the default).
GOTOS Inclusion of this option causes the GOTO statements in the sour
Fortran to be right adjusted in the new Fortran file.
GROUPF Causes all FORMAT statements that appear in each subroutine to
grouped at the end of the subroutine in the new Fortran file.
IGNORE If this option is invoked, then the user will be prompted for a
list of variable and/or subroutine/function names which he woul
like to be ignored when Floppy checks the coding conventions.
This is particularly useful when Floppy is run on external code
containing names over which the user has no control, for exampl
HBOOK calls.
INDENT Inclusion of this option causes all DO and IF clauses to be
indented by nn spaces, according to their level of nesting.
OLD The file name given with this qualifier should refer to an
existing 'FLOPIGN' file, created by a previous Floppy run.
The FLOPIGN file contains the list of coding convention numbers
together with a list of any specified names to be ignored, and
is created automatically when Floppy is run. Specify this
option if you have a particularly complex Floppy environment
that you do not want to re-create each Floppy run.
OUTPUT The file name given with this option will be the file to
which the 'tidied' Fortran is written. By default this file
has the name 'OUTPUT FORTRAN A'.
RENUMF Specifying this option together with a value for START and STEP
will cause all FORMAT statements to be renumbered, beginning at
value START and stepping by STEP.
RENUMS Specifying this option together with a value for START and STEP
will cause ALL statements to be renumbered, beginning at
value START and stepping by STEP.
TIDY This option is automatically selected when any of GOTOS, INDENT
GROUPF, RENUMF, RENUMS are selected on the command line.
TREE Specifying this option causes an analysis file to be written
which may be used as input to the TREE utility. If all the user
requires from Floppy is this analysis file, then he should
specify CHECKS NONE, to avoid Floppy wasting time making any
coding convention checks.
Usage Notes
Here follows the list of coding conventions which may at present
be checked by Floppy. The conventions in the STANDARD set are
marked by an asterisk (*).
* 1 Avoid comment lines after end of module
* 2 End all program modules with the END statement
* 3 Declared COMMON blocks must be used in the module
* 4 COMPLEX and DOUBLEPRECISION vars at end of COMMON
* 5 COMMON block definitions should not change
* 6 Variable names should be 6 or fewer characters long
7 Variables in COMMON should be 6 characters long
8 Variables not in COMMON should be <6 characters
* 9 Integer variables should begin with I to N
* 10 Variable names should not equal FORTRAN keywords
* 11 Avoid comment lines before module declaration
* 12 Module names should not equal intrinsic functions
* 13 First statement in a module should be declaration
* 14 Module should begin with at least 3 comment lines
15 Comment lines should begin with a C
* 16 No comment lines between continuations
* 17 Avoid non-standard variable types eg INTEGER*2
* 18 Avoid multiple COMMON definitions per line
* 19 Do not dimension COMMON variables outside COMMON
* 20 Avoid embedded blanks in variable names
* 21 Avoid embedded blanks in syntactic entities
* 22 Avoid the use of PRINT statements (use WRITE)
23 Do not give the END statement a label
* 24 Avoid WRITE(* construction
25 Avoid WRITE statement in a FUNCTION
* 26 Avoid the use of PAUSE statements
* 27 Statement labels should not begin in column 1
* 28 Always precede STOP by a descriptive WRITE
* 29 Avoid the use of ENTRY in FUNCTIONS
* 30 Avoid using I/O in FUNCTIONs
31 Avoid the use of the alternate RETURN statement
* 32 COMMON block names should not equal variable names
* 33 Avoid use of obsolete CERN library routines
34 Avoid FUNCTION names the same as intrinsics
* 35 Local functions should be declared EXTERNAL
* 36 Module names should all be different
* 37 Avoid expressions of mixed mode eg A=B/I
* 38 Length of passed CHARACTER variables should be *
* 39 Order of statements should conform to note
* 40 Separate Statement Functions by comment lines
* 41 No names in Statement Function definitions elsewhere
42 Use LLT,LGT etc to compare CHARACTER vars. in IFs
43 Variables (not COMMON, not PARAMs) <6 characters
* 44 Passed arguments should be dimensioned * in module